package com.xuedian.xuanxuan.web.dao;


import com.xuedian.xuanxuan.core.generic.GenericDao;
import com.xuedian.xuanxuan.web.model.Token;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface TokenMapper extends GenericDao<Token, Long> {

    int deleteByPrimaryKey(Long id);

    int insertSelective(Token record);

    Token selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Token record);

    /**
     * 根据token查询
     * @param token
     * @return
     */
    List<Token> selectByToken(@Param("token")String token);

    /**
     * 根据userId查询
     * @param userId
     * @return
     */
    List<Token> selectByUserId(@Param("userId")Long userId);
}